Monitoring gamma type-I censored data using an exponentially weighted moving average control chart based on deep learning networks

In recent years, deep learning methods have been widely used in combination with control charts to improve the monitoring efficiency of complete data. However, due to time and cost constraints, data obtained from reliability life tests are often type-I right censored. Traditional control charts become inefficient for monitoring this type of data. Thus, researchers have proposed various control charts with conditional expected values (CEV) or conditional median (CM) to improve efficiency for right-censored data under normal and non-normal conditions. This study combines the exponentially weighted moving average (EWMA) CEV and CM chart with deep learning methods to increase efficiency for gamma type-I right-censored data. A statistical simulation and a real-world case are presented to assess the proposed method, which outperforms the traditional EWMA charts with CEV and CM in various skewness coefficient values and censoring rates for gamma type-I right-censored data.


EWMA charts for gamma type-I censored data
Let U = {u 1 , u 2 , . . ., u m } be a gamma random variable and a 0 and b 0 be the shape and scale parameters of an in-control process, respectively.The censoring rate for the gamma lifetimes can be represented as Pc = 1 − F Ga (u = c T |a 0 , b 0 ) , where F Ga (•|a 0 , b 0 ) is the cumulative distribution function (CDF) of the gamma distribution with parameters a 0 and b 0 , where c T is the censoring time.The CEV of the gamma distribution is: and the CM of the gamma distribution is where F −1 Ga (•|a 0 , b 0 ) is an inverse of CDF of the gamma distribution with a 0 and b 0 .The derivations of Eqs.(1) and (2) are shown in Supplementary.Practitioners take n samples and measure their lifetime values using the reliability life testing method.The sample mean of size n can be obtained by X = n i=1 x i /n .Let u i be the lifetime of the i-th testing sample.Then, the x i of the i-th testing sample in the X 's formula is: where Cd = Cev for CEV X statistic or CM for CM X statistic.The in-control mean M 0 and variance V 0 can be expressed as follows: Let be the smoothing parameter of the EWMA chart.Zhang and Chen 23 showed that the EWMA statistic at period j for monitoring the mean decrease is: For an EWMA chart with CEV or CM used to monitor a process mean, an LCL is set to signal the mean reduction because practitioners always focus on the detection of average lifetime reduction.The appearance of an assignable cause leads to a decrease in the process mean, indicating an out-of-control condition.Let M 1 = δ × M 0 be the mean of an out-of-control state where the process variance is unchanged and δ be a mean shift size that can be obtained by δ = M 1 /M 0 .The gamma shape parameter a 1 and scale parameter b 1 in an out-of-control state can be obtained by solving the following system of simultaneous equations: The solutions for a 1 and b 1 are, respectively, as follows: (1) (4) The primary metric employed for evaluating the effectiveness of control charts is the average run length (ARL) 3,15,23,30,34 .In an in-control process, a larger ARL signifies a reduced false-alarm rate, while in an out-ofcontrol state, a smaller ARL indicates quicker detection of mean reduction.

CNN
The main advantage of CNNs is that they can effectively capture local features in the data and perform feature extraction for classification or regression prediction, while maintaining the spatial hierarchy of features.Some of the main features and working principles of CNN are laid out below.
The convolutional layer is a fundamental element of CNNs.It operates by applying convolutional kernels (also referred to as filters) over the input data or image through a sliding process, resulting in the generation of feature maps.This operation supports the identification of local features.The output of a convolutional layer l can be expressed by: where f RL (•) is a rectified linear unit (ReLU) activation function, l is the l-th layer of the CNN, ω CL l−1 is the filter kernel at layer l − 1 , and b CL l is the bias vector at layer l.The pooling layer plays a crucial role in CNNs by decreasing the dimensionality of feature maps while retaining vital information.The most common pooling operation is max pooling, which selects the highest value within specific regions, thus reducing the feature map's dimensions.The pooling output at layer l is given by: After the convolutional and pooling layers, CNNs frequently incorporate fully connected layers to carry out ultimate classification or regression tasks.These layers are responsible for transforming the extracted features into the network's final output.CNNs commonly comprise a series of convolutional and pooling layers stacked in an interleaved fashion.This layered architecture empowers the network to acquire knowledge about image characteristics spanning diverse levels of abstraction 7,8 .

LSTM
An LSTM is a deep learning neural network architecture that is an improvement of over traditional recurrent neural networks (RNN).It was specially designed to process sequence data, such as speech recognition, natural language processing, time-series analysis, and other applications.LSTM supports sequence data processing by introducing the three key gating mechanisms described below.
The forget gate determines whether to forget the previous memory information.It uses a sigmoid function to output a value between 0 and 1, controlling whether past memories are retained.The forget gate f fg can be expressed as: where f sf (•) is a sigmoid function, b fg is the bias vector of the forget gate, ω fg is the weight vector of the forget gate, ζ t−1 is the output vector of the previous step, and ϑ t is the input vector of the current step.
The input gate determines how new memory information is added to the LSTM unit.It uses a sigmoid function to determine which information needs updating and uses the tanh function to create a memory cell vector.Let f ig be the formula of the input gate and ǫ t be the memory cell vector of the current step, as follows: where b ig is the bias vector of the input gate, ω ig is the weight vector of the input gate, tanh(•) is the tanh func- tion, and b ǫ and ω ǫ are the bias and weight vectors of the memory cell vector for the current step, respectively.
The output gate determines which memory information will be outputted to the next time step.Similar to the forget gate and input gate, the output gate uses a sigmoid function to control the output.The output gate f og is: where b og is the bias vector of the output gate and ω og is the weight vector of the output gate.The output vector of the current step ζ t is: The dimensions of ζ t as the number of hidden units affects the LSTM network's computing efficiency and effectiveness.LSTM uses these gates to control the flow of information and update memory, thus helping to address the gradient vanishing problem in RNNs and allowing them to better handle long sequences 9,36 .

Proposed control charts
This section proposes a procedure to set and implement the control chart based on deep learning networks with EWMA CEV or CM statistic, as shown in Fig. 1.This procedure includes two parts: setting up the control chart and implementing the control chart.
The purpose of setting up the control chart is to find the optimal threshold value according to a specific in-control ARL value to maintain the monitoring effect of the control chart.Before setting up a control chart, practitioners can determine an in-control ARL value and choose an initial threshold value based on their own experience.In the literature, the in-control ARL value used for control chart performance comparison is typically 200 or 370.4.
According to the quality characteristic parameters and control parameters such as a 0 , b 0 , , Pc , and n , the in-control gamma type-I censored data can be generated using the Monte Carlo method and then the in-control EWMA statistics E j for the gamma type-I censored data can be calculated using Eq. (4).It is noted that E j is the EWMA CEV statistic for Cd = Cev or the EWMA CM statistic for Cd = CM .First, 10,000 E j are generated.Next, let {E t−1 , E t } be the training data set and be inputted into the CNN or LSTM network for training.As the training data set, the input layer of the CNN or LSTM network must use one-dimensional sequence data.The input and output vectors have dimensions 1 × (m − 1).
Practitioners are more concerned about decreases in the average lifetime, so the threshold value η as a LCL of traditional control charts is set to detect such decreases.After the network is trained, the estimation E t can be outputted and the residual value can be computed by E t − E t .If the j-th residual value is less than the threshold value η , then the number of points outside the threshold value (OC) = OC + 1.The above procedure is repeated 10,000 times to obtain total number of points outside the threshold value and the in-control ARL value is 10,000/OC (Note that the false alarm rate is OC/10,000).
If the simulated in-control ARL value is not equal to the specific in-control ARL value, then the threshold value η is adjusted and the above simulation procedure is repeated until the simulated ARL value equals the specific ARL value.In this way, the optimal threshold value η * can be obtained and implemented to monitor the process.www.nature.com/scientificreports/ In the implementation of the control chart for process monitoring, practitioners import a trained CNN or LSTM network, set up the optimal threshold value η * , and then apply the following steps: (1) Collect lifetime data for period t − 1 and calculate the statistic E t−1 .
(2) Input E t−1 into this trained network to predict the statistic E t of period t.
(3) After the lifetime data for period t is obtained, compute the actual value E t .(4) Let the error value for period t be E t − E t .
If the error value is less than the optimal threshold value η * , then the process indicates an out-of-control condition; otherwise, the process is in control.
Figure 2 shows the simulation process for an out-of-control ARL value.Practitioners can give a shift size value δ to calculate the parameters a 1 and b 1 of the out-of-control state shown in Fig. 2 using Eq. (5).
Some studies typically considered two different types of performance: zero-state (ZS) and steady-state (SS) 37,38 .ZS performance assumes that a shift occurs at the beginning of the process to measure the out-of-control ARL value.SS performance shows the out-of-control ARL for control charts to identify a process shift for control statistics to reach a static distribution.
For the simulated data generation of ZS and SS conditions, assume that the process has been continuously run for π sampling periods and maintained in the in-control state, π represents the length of the process to reach SS condition.The process occurs the mean shift between π th and π + 1st sampling, and then SS ARL represents the expected value of the number of samples obtained from the occurrence of this mean shift to when the chart indicates an out-of-control signal.In the data generation process, the in-control data of π periods is first gener- ated.After the in-control data, 10,000 out-of-control data are generated.The EWMA statistics are calculated for the data of π + 10,000 using Eq. ( 4), and the last 10,000 EWMA statistics are taken to simulate the out-of-control Figure 2. Flowchart for simulation of an ARL value using the proposed control chart.ARL values of SS condition according to Fig. 2. For ZS condition, the simulated data can be generated with a setting of π = 0.
MATLAB R2023a provides a deep learning toolbox that can easily implement the processes of Figs. 1 and  2. This study codes the simulation processes using MATLAB R2023a to investigate the performance of the proposed control charts.

Performance comparison
Hereafter, 'CNN chart' and 'LSTM chart' represent the control charts based on the CNN and LSTM networks, respectively.This section compares the ARL performance of the CNN, LSTM, and EWMA charts with CEV or CM for gamma type-I censored data.The parameters of the gamma distribution are set as a 0 = 1, 2, and 4 and b 0 = 1 for comparison, while the skewness values (Sk) of the parameter case are as shown in Table 1.Smaller a 0 values indicate greater skewness of the gamma distribution.
When using the CNN network, some network parameters, such as the stacked numbers of convolutional and pooling layers, kernel size, and number of kernels, must be determined first to achieve good training and testing results.For the LSTM chart, the stacked numbers of LSTM layers and the number of hidden units must also be decided.Based on the literature, this study uses the trial-and-error method to set these network parameters as per Table 2 3,39 .
In the performance comparison, the sample size is fixed at n = 5 , which is standard practice for sampling and plotting control charts.The smoothing parameter of the EWMA statistic is set at 0.1 and 0.2 23,27,29 .Pc is 0.2, 0.5, and 0.8 for lower, moderate, and higher censoring rates, respectively.The shift sizes are δ = 0.8 and 0.7 for small shifts; δ = 0.6 and 0.5 for moderate shifts; and δ = 0.2 for large shifts.This study set the in-control ARL value at 200 to measure the out-of-control ARL values under ZS and SS conditions.
Considering that different trained CNN or LSTM networks will have different ARL values, this study trained 100 networks for each condition of process parameters ( a 0 , b 0 , Pc and ) and then selected a trained network with the smallest ARL value for comparison from the 100 trained networks.
Table 3 shows the LCL and the optimal threshold value η * for the six comparison charts under ZS condition ( π = 0).The out-of-control ARL values for the six control charts were simulated according to the above conditions and the ARL values are compared in Table 4.The bold cells indicate the control chart with the best detection efficiency for a specific shift size.
As the skewness coefficient value decreases, the detection efficiency of the six control charts decreases.As Pc increases, the detection efficiency of the EWMA chart decreases, and the detection efficiency of the CNN and LSTM charts changes irregularly.The CNN chart exhibits the best detection ability for most shift sizes.The LSTM chart is significantly worse than the other charts for all shift sizes.Comparing the performance of CEV and CM, CNN with CEV is better than CNN with CM when the skew coefficient value is small.As the skew coefficient value becomes larger, the effect of CNN with CM is better than CNN with CEV.EWMA and LSTM charts are not affected by the skewness coefficient.EWMA and LSTM charts with CEV has better performance than EWMA and LSTM charts with CM.
For processes that often occur the mean shift in the initial stage, if the skewness coefficient of lifetime distribution is large, the EWMA CM statistic should be used to train the CNN network and implement monitoring.On the contrary, the EWMA CEV statistic should be considered to train the CNN network and implement monitoring.
Table 1.Skewness values of the gamma distribution.Pc δ This study considers π = 100 and 1000 to measure the ARL value of SS condition.Table 5 shows the LCL and η * of six control charts for π = 1000.Table 7 exhibits the SS ARL values for π = 100 and 1000, respectively.
As Table 6, CNN chart outperforms EWMA and LSTM for most shift sizes in the π = 1000.With only some cases of δ = 0.8, the EWMA chart is better than the CNN chart.LSTM chart in most cases of δ ≤ 0.5 has better detection efficiency than EWMA chart, but it's still not as efficient as CNN chart.The detection efficiency of LSTM charts in other shift sizes is worse than that of EWMA and CNN charts.The detection efficiency of the EWMA, CNN and LSTM charts decreases as Pc increases or the skewness coefficient of lifetime distribution becomes large for most shift sizes.EWMA, CNN and LSTM charts with CEV have better detection efficiency than EWMA, CNN and LSTM charts with CM in these cases of Pc = 0.2 for all a 0 values and gamma parameters ( a 0 = 4, b 0 = 1) for all Pc values.
Comparing the ARL values of Tables 4 and 6 for ZS ( π = 0) and π = 1000, the EWMA charts with CEV and CM perform worse detection efficiency under ZS condition than under SS condition.In the LSTM charts with CEV and CM, the detection efficiency increases as π increases for most shift sizes, but the efficiency of some small shift sizes performs irregular changes.The CNN charts with CEV and CM have more excellent performance under ZS condition than under SS condition for most shift sizes.As π increases, the detection ability of the CNN charts with CEV and CM in most shift sizes slightly reduced but, in most cases of δ = 0.8, the detection efficiency is significantly reduced.
When the mean shifts occur after the process has been running for a long time, CNN chart will be the best choice for gamma type-I censored data unless there is a need to detect tiny shift sizes.The CNN chart with CEV is suitable for the gamma censored data of lower rates or smaller skewness values, and the CNN chart with CM is recommended for monitoring the moderately, and highly censoring gamma data of larger skewness values.

Real-world case study
A reliability life test for a liquid-crystal display module (LCM) was conducted at a temperature of 70 °C with 80% relative humidity.Based on historical data analysis, the lifetime distribution of an LCM is known to follow a gamma distribution with shape parameter a 0 = 5.72 and scale parameter b 0 = 0.48 .To save testing time and cost, practitioners use the censoring rate Pc = 0.8 to conduct the test and the censoring time c T is found to be 1.76 h.The skewness coefficient value of this lifetime distribution is 0.35, which approximates a symmetrical distribution, therefore EWMA CEV statistics is selected for monitoring the LCM's lifetime.The CEV of this lifetime distribution can be calculated as 3.09.According to quality inspection regulations, five units of each batch of LCMs must be randomly sampled to test lifetime values.Because the EWMA chart based on the CNN network has better performance than the EWMA charts and the EWMA chart on the LSTM network, practitioners developed a CNN-based EWMA chart with CEV using = 0.1 and in-control ARL = 200.As shown in Fig. 1, practitioners trained a CNN network using the EWMA CEV statistics in Eq. ( 4) and obtained the optimal threshold value η * = −0.186for the in-control ARL value of 200.
In line with the above, practitioners tested five units from each batch under conditions of 70 °C and 80% humidity, and halted testing when the test time reached 1.76 h.The EWMA statistics (Eq.( 4)) were inputted into the well-trained CNN network to predict the statistic of the next period.Table 7 showed the lifetime data of testing units for 30 batches.In the 101st batch, only one tested unit failed at 1.23 h and other four tested units did not fail.The lifetime of four unfailed units is recorded as CEV.The actual value E j in Table 7 can be obtained by using Eq. ( 4).As shown in Table 7, the EWMA CEV statistic of the 101st batch was 2.75, so the practitioners inputted 2.75 into the well-trained CNN network, which outputted the predicted value of 2.82 for the 102nd batch.After the 102nd batch was produced and the life tests of the five units reached the termination time of 1.76 h, the actual value E j of this batch was determined to be 2.75 by using Eq. ( 4) and the error value of this batch was − 0.07.
In Table 7, other error values were obtained with the same method.Figure 3a plots these error values for the CNN-based control chart.It can be seen that the error values of batches 119-130 were below the η * value, and so this chart indicates the variation at the 119th batch.Figure 3b

Conclusions
The combination of deep learning methods and control charts has greatly improved the efficiency of process monitoring.However, poor efficiency in the monitoring of high type-I censored data using control charts is a challenge for practitioners.This study proposed a control chart based on deep learning methods with EWMA CEV and CM statistics to detect the mean lifetime reduction for gamma type-I censored data.The ZS and SS ARL values of the proposed charts were also measured.Comparing the ZS and SS ARL values of the EWMA chart and the two EWMA charts based on deep learning methods with CEV and CM, CNN-based EWMA chart outperforms other control charts under ZS condition.For SS condition, the EWMA charts based on CNN with CEV and CM outperformed the other charts for various skewness coefficient values and censoring rates for most shift sizes.The EWMA charts with CEV and CM was slightly better than the CNN-based EWMA charts with CEV and CM for a few tiny shift sizes.The EWMA charts based on LSTM with CEV and CM consistently had the worst performance under ZS and SS conditions.In addition, a real-world case study showed that the CNNbased EWMA chart detected mean lifetime reduction more efficiently than the traditional EWMA CEV chart.
For the gamma censored data of lower rates or smaller skewness coefficient values, the CNN-based EWMA chart with CEV is the best choice, and the CNN-based EWMA chart with CM is recommended monitoring the moderately, and highly censoring data of heavily skewed gamma distribution.Future work could extend current approaches to combine CUSUM CEV and CM statistics with deep learning methods to monitor the censored data with normal or non-normal distributions.In addition, there are opportunities to combine multiple deep learning methods to build control charts.

Figure 1 .
Figure 1.Flowchart for the proposed control chart.

Table 5 .
also shows the EWMA CEV chart with LCL = 2.56 Design parameter values of six control charts for comparison under SS condition.

Figure 3 .
Figure 3.Control charts for monitoring the LCM's censored data.

Table 2 .
Structure and parameters of deep learning networks for the proposed control charts.

Table 3 .
Design parameter values of six control charts for comparison under ZS condition.

Table 4 .
ZS ARL values of six control charts.Smallest ARL values are in [bold].
and its in-control ARL value is approximately 200.The EWMA CEV chart signals the variation at the 121st batch, detecting the same variation more slowly than the CNN-based EWMA chart with CEV.

Table 6 .
SS ARL values of six control charts with π = 1000.Smallest ARL values are in [bold].

Table 7 .
Predicted and error values of the CNN network for the LCM lifetime test. No.